# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pyclutter
pkgver=1.3.2
pkgrel=6
pkgdesc='Python bindings to Clutter.'
arch=('x86_64')
url="http://blogs.gnome.org/clutter/"
license=('GPL')
depends=('glib2>=2.16.0' 'gtk2>=2.10.0' 'clutter>=1.0.0' 'python2-cairo>=1.0.2'
         'pygobject>=2.21.3' 'python2>=2.6.0' 'pygtk')
options=('!libtool')
source=("http://pkgs.fedoraproject.org/repo/pkgs/pyclutter/pyclutter-$pkgver.tar.bz2/36137bace35d03af4caf20747ccdc5c2/pyclutter-$pkgver.tar.bz2"
        'pyclutter.patch')
sha512sums=('4f957bf570d39715f83e002e5d1dfba8f4f2ce62c16f69a4768be9df82be356b7e53f7b313e6ca1d2ffaefa7aa4c97d219d56248bc12410d180c558c81dcbeca'
            '213bb8f844d6e917e495a27855cbf7f06289a2779a1a4c44a4799485b24bfe08bad5953c2eb10bc787d4d286b878a9d53a709d34742a6be9c4c851e2c8fa4d11')

prepare() {
  cd "$pkgname-$pkgver"

  patch -Np1 -i ../pyclutter.patch
}

build() {
  cd "$pkgname-$pkgver"

  find . -name '*.py' -print0 | xargs -0 \
    sed -i -e 's,^#!/usr/bin/env python$,#!/usr/bin/env python2,' \
    -e 's,^#!/usr/bin/python$,#!/usr/bin/python2,'

  export PYTHON=/usr/bin/python2

  ./configure --prefix=/usr

  make
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install
}

